import * as moment from 'moment';
import { Injectable } from '@angular/core';
declare var Neon: any;


@Injectable()
export class ModelApi {
  public selector: any;
  public constructor() {
  }

  public getClassInfo(uuids?: string[] | string) {
    if (!uuids) {
      // 获取模型中全部class
      return Neon.getSelector().getClassInfo();
    } else if (uuids.length === 1) {
      // 单个构件的类名
      return Neon.getSelector().getClassInfo(uuids[0]);
    } else {
      // 多个构件的类名对象
      return Neon.getSelector().getClassInfo(uuids);
    }
  }

  //
  public getAttrOfClass(className: string) {
    return Neon.getSelector().getClassInfo(className, true);
  }

  // 获取选中构件uuid
  public getUUids() {
    return Neon.getSelector().get();
  }

  // 获取构件所有的属性
  public getproperty(uuid: string) {
    return Neon.getproperty(uuid);
  }



}
